package com.example.springboot.ytest.ytest;

import java.util.concurrent.locks.LockSupport;

/**
 * @author luffy
 * @date 2021-04-27
 **/
public class InterruptTest {

    static void fun(Thread tt) {
        System.out.println("is interrupt: "+tt.isInterrupted());
        tt.interrupt();
        System.out.println("is interrupt2: "+tt.isInterrupted());
    }

    public static void main(String[] args) {
        Thread thread = Thread.currentThread();
        Thread tt = new Thread(() -> fun(thread));
        tt.start();
        LockSupport.park();
    }
}
